<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 权限
 * Class CreatePermissionsTable
 */
class CreatePermissionsTable extends Migration
{
	/**
	 * Run the migrations.
	 * @return void
	 */
	public function up() {
		// 权限表
		Schema::create('permissions', function (Blueprint $table) {
			$table->increments('id');
			$table->unsignedInteger('pid')->default(0)->comment('父级ID');
			$table->string('name', 20)->default('')->comment('权限名称');
			$table->string('route', 100)->default('')->comment('路由别名');
			$table->enum('is_menu',['0','1'])->default('0')->comment('是否显示到菜单中');
			$table->timestamps();
			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('permissions');
	}
}
